import java.util.Scanner;

class Teacher{
    int no;
    String name;
    int age;
    String seminary;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSeminary() {
        return seminary;
    }

    public void setSeminary(String seminary) {
        this.seminary = seminary;
    }


    public boolean equals(Teacher obj) {
        if (this.no == obj.no){
            return true;
        }else {
            return false;
        }
    }

    public Teacher(int no, String name, int age, String seminary) {
        this.no = no;
        this.name = name;
        this.age = age;
        this.seminary = seminary;
    }

    @Override
    public String toString() {
        return "no: " + no + ", name:" + name + ", age: " + age + ", seminary: " + seminary;
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int no1 = scanner.nextInt();
        String name1 = scanner.next();
        int age1 = scanner.nextInt();
        String seminary1 = scanner.next();
        Teacher teacher1 = new Teacher(no1,name1,age1,seminary1);
        System.out.println(teacher1.toString());
        int no2 = scanner.nextInt();
        String name2 = scanner.next();
        int age2 = scanner.nextInt();
        String seminary2 = scanner.next();
        Teacher teacher2 = new Teacher(no2,name2,age2,seminary2);
        System.out.println(teacher2.toString());
        System.out.println(teacher1.equals(teacher2));
    }
}